package com.icart.entities;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

@Entity
@Table(name = "wo_infopay", schema = "amp", catalog = "")
public class WoInfopayEntity {
    private long pid;
    private Integer custid;
    private Long tradeid;
    private String paytype;
    private BigDecimal amount;
    private Timestamp tradetime;
    private Integer payee;
    private String receivno;

    @Id
    @Column(name = "pid")
    public long getPid() {
        return pid;
    }

    public void setPid(long pid) {
        this.pid = pid;
    }

    @Basic
    @Column(name = "custid")
    public Integer getCustid() {
        return custid;
    }

    public void setCustid(Integer custid) {
        this.custid = custid;
    }

    @Basic
    @Column(name = "tradeid")
    public Long getTradeid() {
        return tradeid;
    }

    public void setTradeid(Long tradeid) {
        this.tradeid = tradeid;
    }

    @Basic
    @Column(name = "paytype")
    public String getPaytype() {
        return paytype;
    }

    public void setPaytype(String paytype) {
        this.paytype = paytype;
    }

    @Basic
    @Column(name = "amount")
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "tradetime")
    public Timestamp getTradetime() {
        return tradetime;
    }

    public void setTradetime(Timestamp tradetime) {
        this.tradetime = tradetime;
    }

    @Basic
    @Column(name = "payee")
    public Integer getPayee() {
        return payee;
    }

    public void setPayee(Integer payee) {
        this.payee = payee;
    }

    @Basic
    @Column(name = "receivno")
    public String getReceivno() {
        return receivno;
    }

    public void setReceivno(String receivno) {
        this.receivno = receivno;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WoInfopayEntity that = (WoInfopayEntity) o;

        if (pid != that.pid) return false;
        if (custid != null ? !custid.equals(that.custid) : that.custid != null) return false;
        if (tradeid != null ? !tradeid.equals(that.tradeid) : that.tradeid != null) return false;
        if (paytype != null ? !paytype.equals(that.paytype) : that.paytype != null) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (tradetime != null ? !tradetime.equals(that.tradetime) : that.tradetime != null) return false;
        if (payee != null ? !payee.equals(that.payee) : that.payee != null) return false;
        if (receivno != null ? !receivno.equals(that.receivno) : that.receivno != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (pid ^ (pid >>> 32));
        result = 31 * result + (custid != null ? custid.hashCode() : 0);
        result = 31 * result + (tradeid != null ? tradeid.hashCode() : 0);
        result = 31 * result + (paytype != null ? paytype.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (tradetime != null ? tradetime.hashCode() : 0);
        result = 31 * result + (payee != null ? payee.hashCode() : 0);
        result = 31 * result + (receivno != null ? receivno.hashCode() : 0);
        return result;
    }
}
